package com.aaa.service;

import com.aaa.dao.StudentDao;
import com.aaa.dao.impl.StudentDaoImpl;
import com.aaa.entity.Pager;
import com.aaa.entity.StudentEntity;
import com.aaa.util.PageUtil;
import java.util.Map;

public class StudentServiceImpl implements StudentService {

    StudentDao dao=new StudentDaoImpl();
    @Override
    public Pager query(int curPage, int pageSize, Map condition) {
        pageSize= PageUtil.PAGE_SIZE;
        return dao.query(curPage, pageSize,condition);
    }

    @Override
    public int create(StudentEntity info) {
        if (info.getStuid()==0) {
            return dao.create(info);
        }else
        {
            return dao.update(info);
        }
    }

    @Override
    public int delete(int stuid) {
        return dao.delete(stuid);
    }

    @Override
    public Map queryid(int stuid) {
        return dao.queryid(stuid);
    }
}
